<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>客户详细信息</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="${ctx}/rs/js/jquery.validate.min.js"></script>
<script src="${ctx}/rs/js/jquery.form.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" class="form-horizontal" action="${ctx}/Feedbac/save.htm" method="post" enctype="multipart/form-data">
		<div class="form-group">
			<label for="recipient-name" class="control-label col-sm-2">回复</label>
			<div class="col-sm-10">
			<input type="hidden" id = "feedid"  value ="${feedid }"/>
				<textarea class="form-control feedback_content" row=3 id = "feedback_content"
					style="width:300px;" placeholder=" 请输入不超过500个字的回复内容 "></textarea>
			</div>
		</div>
		
        <div id="divRadioName" class="form-group" >
        <label for="name" class="col-sm-2 control-label item wid1">已回复内容：</label>
        <div class="col-sm-9 wid2" style="padding: 10px;border: 1px #E3E3E3 solid;">
             <c:forEach items="${feedislists}" var="feedislist">
                  <span >${feedislist.feedback_content}</span><br />
                  <span>${create_time}</span><br />
                  <div style="border: 1px #E3E3E3 solid;"></div>
             </c:forEach>
        </div>
      </div>
     <div class="form-group">
        <div class="col-sm-10 text-center pt15">
             <button type="button" class="btn btn-primary btn-lg srt-btn active mr30" onclick="valiSubmit()">提交</button>
        </div>
      </div>
</form>


<script type="text/javascript" src="${ctx}/rs/js/bootstrapQ.min.js"></script>
<script src="${ctx}/rs/js/messages_zh.min.js"></script>
<script type="text/javascript">
function valiSubmit(){
              var id = $("#feedid").val();
              var feedback_content = $("#feedback_content").val();
              if(!feedback_content){
                    alert("请填写回复内容！");
                    return;
                }
              if(feedback_content.length>500){
                  alert("内容不超过500个字");
                  return;
              }
              $.ajax({
                   url: "${ctx}/Feedbac/save.htm", 
                  type: 'POST',
                  data: {
                      id:id,
                      feedback_content:feedback_content
                  },
                    success: function (text) {
                        bootstrapQ.msg({
                            msg  : '操作成功！',
                            type : 'success',
                            time : 2000
                        });
                        setTimeout("window.location.reload(true)",2000);
                    },
                    error: function () {
                        bootstrapQ.msg({
                            msg  : '操作失败！',
                            type : 'danger',
                            time : 2000
                        });
                        setTimeout("window.location.reload(true)",1000);
                    } 
             }); 
}
</script>
</body>
</html>